<?php

declare(strict_types=1);

namespace App\Request\ai;

use Hyperf\Validation\Request\FormRequest;

/**
 * 文本模型 验证器
 */
class ImageModelRequest extends FormRequest
{

    protected array $scenes = [
        'create' => ['name', 'api_url', 'manufacturer_id',  'status'],
        'update' => ['id', 'name', 'api_url', 'manufacturer_id',  'status'],
        'delete' => ['id'],
        'updateStatus' => ['id', 'status'],
    ];


    public function authorize(): bool
    {
        return true;
    }


    public function rules(): array
    {
        return [
            'id'=>'required|integer',
            'name'=>'required|string',
            'api_url'=>'required|string',
            'manufacturer_id'=>'required|integer',
            'params'=>'required',
            'status'=>'required|integer',
            'updated_at'=>'required|string',
            'created_at'=>'required|string',
        ];
    }
    public function messages(): array
    {
        return [
            'id.required'=>'请输入id',
            'id.integer'=>'id必须为数字',
            'name.required'=>'请输入name',
            'name.string'=>'name必须为字符串',
            'api_url.required'=>'请输入模型api',
            'api_url.string'=>'api必须为字符串',
            'manufacturer_id.required'=>'请选中厂商',
            'manufacturer_id.integer'=>'manufacturer_id必须为数字',
            'params.required'=>'请输入参数',
        ];
    }
}
